﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;

using LowLevelGraphics.Extractors;

namespace ImageRecognition2.Action
{
    /// <summary>
    /// Action Extractor
    /// </summary>
    public class ActionExtractor : AbstractCommand
    {
        private PictureBox m_PictureBox = null;

        /// <summary>
        /// Initializes a new instance of the <see cref="ActionExtractor"/> class.
        /// </summary>
        /// <param name="_pictureBox">The _picture box.</param>
        public ActionExtractor(PictureBox _pictureBox)
        {
            m_PictureBox = _pictureBox;
        }

        /// <summary>
        /// Runs the specified sender.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public override void Run(object sender, EventArgs e)
        {
            Bitmap bitmapMask = null;
            Extractor extractor = new Extractor();
            extractor.Prepare();
            extractor.Extract((Bitmap)this.m_PictureBox.BackgroundImage, bitmapMask);
        }
    }
}
